php pdo rowcount

46

sql row count php pdo -

<?php
/* Delete all rows from the FRUIT table */
$del = $dbh->prepare('DELETE FROM fruit');
$del->execute();

/* Return number of rows that were deleted */
print("Return number of rows that were deleted:\n");
$count = $del->rowCount();
print("Deleted $count rows.\n");
?>

php pdo rowcount -

$stmt = $db->query('SELECT * FROM table');
$row_count = $stmt->rowCount();

Comments

Submit
0 Comments